# ifndef DEF_GUI
# define DEF_GUI

# include "Source.h"

# include "Module.h"

/*
*	This class creates the menus and the GUI and handles the events related to these.
*/

class GUI : public Module
{
	public:

	GUI( Game*);
	~GUI();

	void setWorld( World*);

	bool init( Renderer*);
	void oneFrame();

	CEGUI::Window* findWindow( CEGUI::String&);

	private:

	virtual void handleEvents();

	void createMenu();
	void createGame();
	void createGameMenu();
	void createGameDeath();
	void createGameInventory();
	void createGameCompetence();
	void createGameQuest();
	void createGameTalk();

	void closeWindowOpen();

	void addDialog( PieceDialog*);

	bool newGame( const CEGUI::EventArgs&);
	bool loadGame( const CEGUI::EventArgs&);
	bool quit( const CEGUI::EventArgs&);

	bool returnGame( const CEGUI::EventArgs&);
	bool returnMenu( const CEGUI::EventArgs&);

	bool closeCompetence( const CEGUI::EventArgs&);
	bool closeInventory( const CEGUI::EventArgs&);

	bool mouseMovedInventory( const CEGUI::EventArgs&);
	bool clearPanelComp( const CEGUI::EventArgs&);
	bool clickInventory( const CEGUI::EventArgs&);

	bool closeQuest( const CEGUI::EventArgs&);
	bool detailQuest( const CEGUI::EventArgs&);

	bool clickMouseDialog( const CEGUI::EventArgs&);

	Renderer* myRenderer;
	CEGUI::OgreRenderer* myCeguiRenderer;
	CEGUI::WindowManager* myWindowManager;

	World* myWorld;
	Hero* myHero;
};

# endif